All Packages Class Hierarchy This Package Previous Next Index
Class java.naming.CompoundName
java.lang.Object
|
+----java.naming.CompoundName
- public class CompoundName
- extends Object
- implements Cloneable, Name
The CompoundName class represents a compound name -- a name from
a hierarchical name space. Each component in a compound name is an
atomic name.
The components of a compound name are numbered. The indexes of a
compound name with N components range from 0 up to, but not including, N.
This range may be written as [0,N). An empty compound name has no
components.
The syntax of a compound name is specified using a set of properties:
jndi.syntax.direction Direction for parsing ("right_to_left", "left_to_right", "flat")
jndi.syntax.separator Separator between atomic name components. Required unless direction is "flat."
jndi.syntax.ignorecase If present, true means is case insensitive; case sensitive otherwise.
jndi.syntax.escape If present, escape string for overriding separator, escapes and quotes
jndi.syntax.beginquote If present, string delimiting start of quoted string
jndi.syntax.endquote String delimiting end of quoted string.
If not present, use syntax_begin_quote1 as end quote.
jndi.syntax.beginquote2 Alternative set of begin/end quotes.
jndi.syntax.endquote2 Alternative set of begin/end quotes.
jndi.syntax.separator.ava If present, string that separates attribute-value-assertions
when specifying multiple attribute/value pairs.
(e.g. "," in age=65,gender=male).
jndi.syntax.separator.typeval If present, string that separators attribute
from value (e.g. "=" in "age=65")
-
impl
-
-
mySyntax
-
-
CompoundName(String, Properties)
- Constructs a new compound name instance by parsing the string n
using the syntax specified by the syntax properties supplied.
-
CompoundName(StringEnumeration, Properties)
-
-
appendComponent(String)
- Adds a single component to the end of this compound name.
-
appendName(Name)
- Adds the components of a compound name -- in order -- to the end of
this compound name.
-
clone()
- Creates a copy of this compound name.
-
deleteComponent(int)
- Deletes a component from this compound name.
-
equals(Object)
- Determines whether obj is syntactically equal to this compound name.
-
getComponent(int)
- Retrieves a component of this compound name.
-
getComponentCount()
- Retrieves the number of components in this compound name.
-
getComponents()
- Retrieves the components of this compound name as an enumeration
of strings.
-
getPrefix(int)
- Retrieves a compound name whose components consist of a prefix of the
components in this compound name.
-
getSuffix(int)
- Retrieves a compound name whose components consist of a suffix of the
components in this compound name.
-
hashCode()
- Computes the hash code of this compound name.
-
insertComponent(int, String)
- Adds a single component at a specified position within this
compound name.
-
insertName(int, Name)
- Adds the components of a compound name -- in order -- at a specified
position within this compound name.
-
isEmpty()
- Determines whether this compound name is empty.
-
isPrefix(Name)
- Determines whether a compound name is a prefix of this compound name.
-
isSuffix(Name)
- Determines whether a compound name is a suffix of this compound name.
-
prependComponent(String)
- Adds a single component to the start of this compound name.
-
prependName(Name)
- Adds the components of a compound name -- in order -- to the beginning
of this compound name.
-
toString()
- Generates the string representation of this compound name, using
the syntax rules of the compound name.
impl
protected NameImpl impl
mySyntax
protected Properties mySyntax
CompoundName
protected CompoundName(StringEnumeration comps,
Properties syntax)
CompoundName
public CompoundName(String n,
Properties syntax) throws InvalidNameException
- Constructs a new compound name instance by parsing the string n
using the syntax specified by the syntax properties supplied.
- Parameters:
- n - The string to parse.
- syntax - A list of properties that specify the syntax of
this compound name.
toString
public String toString()
- Generates the string representation of this compound name, using
the syntax rules of the compound name.
- Returns:
- A string representation of this compound name.
- Overrides:
- toString in class Object
equals
public boolean equals(Object obj)
- Determines whether obj is syntactically equal to this compound name.
- Parameters:
- obj - The object to compare against.
- Returns:
- true if obj is equal to this compound name, false otherwise.
- Overrides:
- equals in class Object
hashCode
public int hashCode()
- Computes the hash code of this compound name.
- Returns:
- The hash code computed using characters from this compound
name.
- Overrides:
- hashCode in class Object
clone
public Object clone()
- Creates a copy of this compound name.
- Returns:
- A copy of this compound name.
- Overrides:
- clone in class Object
getComponentCount
public int getComponentCount()
- Retrieves the number of components in this compound name.
- Returns:
- The number of components in this compound name.
isEmpty
public boolean isEmpty()
- Determines whether this compound name is empty.
- Returns:
- true if this compound name is empty, false otherwise.
getComponents
public StringEnumeration getComponents()
- Retrieves the components of this compound name as an enumeration
of strings.
- Returns:
- An enumeration of the components of this compound name.
getComponent
public String getComponent(int posn)
- Retrieves a component of this compound name.
- Parameters:
- posn - The 0-based index of the component to retrieve.
Must be in the range [0,getComponentCount()).
- Returns:
- The component at index posn.
getPrefix
public Name getPrefix(int posn)
- Retrieves a compound name whose components consist of a prefix of the
components in this compound name.
- Parameters:
- posn - The 0-based index of the component at which to stop.
Must be in the range [0,getComponentCount()].
- Returns:
- A compound name consisting of the components at indexes in
the range [0,posn).
getSuffix
public Name getSuffix(int posn)
- Retrieves a compound name whose components consist of a suffix of the
components in this compound name.
- Parameters:
- posn - The 0-based index of the component at which to start.
Must be in the range [0,getComponentCount()].
- Returns:
- A compound name consisting of the components at indexes in
the range [posn,getComponentCount()). If posn is equal to
getComponentCount(), an empty compound name is returned.
isPrefix
public boolean isPrefix(Name n)
- Determines whether a compound name is a prefix of this compound name.
A compound name 'n' is a prefix if it is equal to
getPrefix(n.getComponentCount()).
- Parameters:
- n - The compound name to check.
- Returns:
- true if n is a prefix of this compound name, false otherwise.
isSuffix
public boolean isSuffix(Name n)
- Determines whether a compound name is a suffix of this compound name.
A compound name 'n' is a suffix if it it is equal to
getSuffix(getComponentCount()-n.getComponentCount()).
- Parameters:
- n - The compound name to check.
- Returns:
- true if n is a suffix of this compound name, false otherwise.
prependName
public void prependName(Name prefix) throws InvalidNameException
- Adds the components of a compound name -- in order -- to the beginning
of this compound name.
- Parameters:
- prefix - The components to add.
appendName
public void appendName(Name suffix) throws InvalidNameException
- Adds the components of a compound name -- in order -- to the end of
this compound name.
- Parameters:
- suffix - The components to add.
insertName
public void insertName(int posn,
Name n) throws InvalidNameException
- Adds the components of a compound name -- in order -- at a specified
position within this compound name.
Components of this compound name at or after the index of the first
new component are shifted to accommodate the new components.
- Parameters:
- n - The components to add.
- posn - The index in this name at which to add the new
components. Must be in the range [0,getComponentCount()].
prependComponent
public void prependComponent(String comp) throws InvalidNameException
- Adds a single component to the start of this compound name.
- Parameters:
- comp - The component to add.
appendComponent
public void appendComponent(String comp) throws InvalidNameException
- Adds a single component to the end of this compound name.
- Parameters:
- comp - The component to add.
insertComponent
public void insertComponent(int posn,
String comp) throws InvalidNameException
- Adds a single component at a specified position within this
compound name.
Components of this compound name at or after the index of the new
component are shifted by one to accommodate the new component.
- Parameters:
- comp - The component to add.
- posn - The index at which to add the new component.
Must be in the range [0,getComponentCount()].
deleteComponent
public void deleteComponent(int posn) throws InvalidNameException
- Deletes a component from this compound name.
- Parameters:
- posn - The index of the component to delete.
Must be in the range [0,getComponentCount()].
All Packages Class Hierarchy This Package Previous Next Index